<template>
	<view>
		<view class="cu-modal" :class="modalName=='InputModal'?'show':''">
			<view class="cu-dialog">
				<view class="cu-bar justify-between padding-sm bg-white">
					<view class="text-bold text-size-30">{{title}}</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-sm bg-white">
					<input @input="onChangeValue"  :value="inputValue" placeholder="请输入内容" name="value" />
				</view>
				<view class="cu-bar bg-white">
					<view class="action margin-0 flex-sub  solid-left" @tap="onClick">{{$lang('confirm')}}</view>
					<view class="action margin-0 flex-sub  solid-left" @tap="hideModal">{{$lang('cancel')}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				inputValue: ''
			};
		},
		name: 'cu-custom',
		computed: {
			style() {
				var style = ""
				return style
			}
		},
		props: {
			datas: {},
			title: {
				type: String,
				default: '标题'
			},
			modalName: {
				type: [Boolean, String],
				default: null
			}
		},
		methods: {
			hideModal(e) {
				this.$emit('onhide');
			},
			onClick() {
				this.$emit('onclick', this.inputValue);
			},
			onChangeValue(e) {
				this.inputValue = e.target.value;
			}
		}
	}
</script>

<style scoped>

</style>
